package com.maya.medicalwastes.util;


/**
 * @description 菜单的工具类
 * @user gzl
 * @date 2017/8/2
 * @time 13:26
 */

public class MenuUtil {
    /**
     * @description 过滤菜单图标的样式
     * @author gzl
     * @time 2017/8/2 13:28
     */
    public static String filterIconCls(String icon) {
        if (StringUtils.isEmpty(icon)) {
            return "{fa-align-justify}";
        } else {
            if (icon.contains("glyphicon")) {
                return "{" + icon.replace(' ', '-') + "}";
            } else if (icon.contains("fa")) {
                return "{" + icon.replace("fa ", "").replace(" ","") + "}";
            } else if (icon.contains("icon ")) {
                return "{" + icon.replace("icon ", "").replace(" ","") + "}";
            }
            else {
                return "{" + icon + "}";
            }
        }
    }
}
